Skip to content

fix: resolve cross-package test failures and type errors - #192

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2281-1790583762
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2281-1790583762

Conversation

@stooit

@stooit stooit commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

bun test && tsc --noEmit now passes from the repo root: 13 tests pass, 0 fail, and tsc exits 0. No test files were modified and no dependencies were added.

File Fix
apps/web/src/lib/api.ts Imported useThrottle, which was renamed to useDebounce in packages/utils. The public useSearchDebounce re-export still works.
packages/ui/src/components/Button/Button.tsx aria-label is now rendered on the <button>. Icon-only buttons get a fallback name and a dev-only warning.
packages/ui/src/components/DataTable/DataTable.tsx Stale closure in handleSort. It now uses the functional setSortDir(prev => ...).
packages/utils/src/format/date.ts formatDate gave 01/03/2024. It now gives en-AU 1/03/2024 / 15/06/2024: no leading zero on the day, 4-digit year.
bunfig.toml environment = "happy-dom" is not a real Bun option, so a bare bun test never set up a DOM. It now preloads the existing packages/ui/test/setup.ts.
tsconfig.json Added "types": ["bun-types"] so bun:test resolves under tsc.

Assumptions

  • Date format: the target is D/MM/YYYY, taken from the comments in the date tests. A first attempt with dateStyle: "short" passed but produced a 2-digit year, so it was replaced after review. formatDateTime is unchanged and still uses the short style.
  • Button fallback label: the icon-only test renders with no label and asserts that aria-label is non-null, so a runtime fallback is required. Making the label required in the type would break tsc on that test. The fallback value "Button" doesn't describe the button to screen-reader users. A follow-up should make callers always pass a real label.
  • bunfig change: bun run test already passed --preload on the command line. The task runs a bare bun test, which needs the root bunfig fix.

- utils: formatDate emits en-AU D/MM/YYYY without leading-zero day
- ui: Button renders aria-label, with fallback for icon-only buttons
- ui: DataTable sort toggle uses functional state update (stale closure)
- web: import renamed useDebounce instead of useThrottle
- config: root bunfig preloads DOM setup; tsconfig loads bun-types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant